from builtins import input
theBoard = {'T-L':' ', 'T-M': ' ', 'T-R': ' ',
            'M-L':' ', 'M-M': ' ', 'M-R': ' ',
            'B-L':' ', 'B-M': ' ', 'B-R': ' '}

def printBoard(board):
    print(board['T-L'] + '|' + board['T-M'] + '|' + board['T-R'])
    print('-+-+-')
    print(board['M-L'] + '|' + board['M-M'] + '|' + board['M-R'])
    print('-+-+-')
    print(board['B-L'] + '|' + board['B-M'] + '|' + board['B-R'])
    
turn = 'X'
for i in range(9):
    printBoard(theBoard)
    print('Turn for '+turn+'. Move on which space?')    
    move = input()
    theBoard[move] = turn
    if turn == 'X':
        turn = 'O'
    else:
        turn = 'X'
printBoard(theBoard)